<template>
  <div class="quiz-main-wrapper">
    <router-view />
  </div>
</template>
<script>
import * as CONSTANTS from '@/constants/index'

export default {
  props: {},
  components: {},
  data() {
    return { CONSTANTS: Object.freeze(CONSTANTS) }
  },
  computed: {},
  mounted() {
    // console.log(`${window.location.href} is mounting ===>>>>`)
    // this.$store.commit(CONSTANTS.COMMIT_STORAGE_VUEXSTATE)
    let data = window.sessionStorage.getItem(CONSTANTS.STORAGE_VUEX_STATE)
    data = JSON.parse(data)
    this.$store.replaceState(Object.assign({}, data))
    window.onbeforeunload = () => {
      this.store.commit(CONSTANTS.COMMIT_STORAGE_VUEXSTATE)
    }
  },
  filters: {},
  watch: {},
  methods: {},
}
</script>

<style lang="less" scoped>
.quiz-main-wrapper {
  min-height: 100%;
}
</style>
